"""
给定姓名和身高，把姓名按身高降序排列
"""
from typing import List

class T(object):
    """
    定义一个object，重载<，升序排序
    """
    def __init__(self, name: str, height: int) -> None:
        self.name = name
        self.height = height
    def __lt__(self, other: 'T') -> bool:
        if self.height != other.height: return self.height > other.height
        return self.name < other.name

class Solution:
    def sortPeople(self, names: List[str], heights: List[int]) -> List[str]:
        a = []
        for s, h in zip(names, heights):
            a.append(T(s, h))
        a.sort()
        ans = []
        for ai in a:
            ans.append(ai.name)
        return ans